#ifndef ARTICLECREATOR_H
#define ARTICLECREATOR_H

#include <QObject>

class QNetworkReply;
class QNetworkAccessManager;
class ArticleCreator : public QObject
{
    Q_OBJECT
public:
    explicit ArticleCreator(QObject *parent = nullptr);

    // 设置请求模式（同步或异步）
    void setSyncMode(bool sync);

    // 创建文章
    void createArticle(const QString& title, const QString& content, const QList<QString>& images);

signals:
    void articleCreated(bool success, const QString& message);

private slots:
    void onRequestFinished(QNetworkReply* reply);
private:
    QNetworkAccessManager* httpManager;
    bool isSync; // 请求模式标志位
};

#endif // ARTICLECREATOR_H
